import request from '@/utils/request';

/**
 * 上传图片
 */
export async function upload(data) {
  const res = await request.post('/upload', data);
  if (res.data.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}
/**
 * 上传图片列表
 */
export async function uploadImg(data) {
  const res = await request.post('/log/uploadImg', data);
  if (res.data.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

// 上传记录

export async function imgLog(data) {
  const res = await request.post('/log/imgLog', data);
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

// 删除图片列表
export async function uploadDel(data) {
  const res = await request.post('/log/uploadDel', data);
  if (res.data.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}
//
export async function delComment(data) {
  const res = await request.post('/delComment', data);
  if (res.data.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}
